/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package estructurassa.controladores.ABMProducto;

import autocompletar.componente.AutoCompletarTextField;
import estructurassa.utiles.modeloTabla.ModeloTabla;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author diego
 */
public class PantallaProductoTerminadoJDialog extends javax.swing.JDialog {

    /**
     * Creates new form PantallaProductoTerminadoJDialog
     */
    public PantallaProductoTerminadoJDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    public AutoCompletarTextField getAutoCompletarComponente() {
        return autoCompletarComponente;
    }

    public JButton getBtnAgregarComponente() {
        return btnAgregarComponente;
    }

    public JComboBox getCbxUnidadMedida() {
        return cbxUnidadMedida;
    }

    public JTable getTblEstructura() {
        return tblEstructura;
    }

    public JTextField getTxtCantidad() {
        return txtCantidad;
    }


    public JTextField getTxtDescripcion() {
        return txtDescripcion;
    }

    public JTextField getTxtNombre() {
        return txtNombre;
    }

    public JFormattedTextField getTxtPorcentaje() {
        return txtPorcentaje;
    }

    public JComboBox getCbxClasificación() {
        return cbxClasificación;
    }

    public JButton getBtnGuardar() {
        return btnGuardar;
    }

    public JButton getBtnNuevaClasificacion() {
        return btnNuevaClasificacion;
    }

    public JButton getBtnQuitar() {
        return btnQuitar;
    }

    public JLabel getLblPorcentajeG() {
        return lblPorcentajeG;
    }

    public JPanel getjPanelEstructuraProducto() {
        return jPanelEstructuraProducto;
    }

    public JButton getBtnNuevoDetalle() {
        return btnNuevoDetalle;
    }
    public JTextField getTxtCostoAlmacenamiento() {
        return txtCostoAlmacenamiento;
    }

    public JComboBox getCbxModeloGestStock() {
        return cbxModeloGestStock;
    }

    public void limpiarCampos() {
        txtCantidad.setText("");
        txtDescripcion.setText("");
        txtNombre.setText("");
        txtPorcentaje.setText("");
        txtCostoAlmacenamiento.setText("");
        cbxUnidadMedida.setSelectedIndex(0);
        cbxClasificación.setSelectedIndex(0);
        cbxModeloGestStock.setSelectedIndex(0);
        autoCompletarComponente.setTexto("");
        ((ModeloTabla) tblEstructura.getModel()).setListaElementos(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        lblPorcentajeG = new javax.swing.JLabel();
        txtNombre = new javax.swing.JTextField();
        txtDescripcion = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        cbxClasificación = new javax.swing.JComboBox();
        btnNuevaClasificacion = new javax.swing.JButton();
        txtPorcentaje = new javax.swing.JFormattedTextField(new Float(0f));
        txtCostoAlmacenamiento = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        cbxModeloGestStock = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        jPanelEstructuraProducto = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblEstructura = new javax.swing.JTable();
        autoCompletarComponente = new autocompletar.componente.AutoCompletarTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        cbxUnidadMedida = new javax.swing.JComboBox();
        btnAgregarComponente = new javax.swing.JButton();
        btnQuitar = new javax.swing.JButton();
        btnNuevoDetalle = new javax.swing.JButton();
        txtCantidad = new javax.swing.JTextField();
        jToolBar1 = new javax.swing.JToolBar();
        btnGuardar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Producto"));

        jLabel1.setText("Nombre Producto");

        jLabel2.setText("Descripción");

        lblPorcentajeG.setText("Porcentaje de Ganancia");

        jLabel6.setText("Clasificaion");

        cbxClasificación.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        btnNuevaClasificacion.setText("Nueva");

        jLabel3.setText("Costo Almacenamiento");

        cbxModeloGestStock.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel10.setText("Modelo Gestion Stock");
        jLabel10.setToolTipText("Costo Almacenamiento");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(lblPorcentajeG)
                    .addComponent(jLabel3)
                    .addComponent(jLabel10))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(cbxClasificación, javax.swing.GroupLayout.PREFERRED_SIZE, 392, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnNuevaClasificacion, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(txtCostoAlmacenamiento, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(txtNombre, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
                        .addComponent(txtDescripcion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
                        .addComponent(txtPorcentaje, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
                        .addComponent(cbxModeloGestStock, javax.swing.GroupLayout.Alignment.LEADING, 0, 392, Short.MAX_VALUE)))
                .addContainerGap(527, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cbxClasificación, cbxModeloGestStock, txtCostoAlmacenamiento, txtDescripcion, txtNombre, txtPorcentaje});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPorcentajeG)
                    .addComponent(txtPorcentaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(cbxClasificación, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnNuevaClasificacion))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCostoAlmacenamiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbxModeloGestStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {cbxClasificación, cbxModeloGestStock, txtCostoAlmacenamiento, txtDescripcion, txtNombre, txtPorcentaje});

        jPanelEstructuraProducto.setBorder(javax.swing.BorderFactory.createTitledBorder("Estructura Producto"));

        tblEstructura.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Codigo", "Nombre", "Tipo", "Cantidad", "Unidad Medida"
            }
        ));
        jScrollPane1.setViewportView(tblEstructura);

        jLabel4.setText("Cantidad");

        jLabel5.setText("Unidad Medida");

        cbxUnidadMedida.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecionar Elemento", "mm", "cm", "m", "m2", "kg", "l", "unidad" }));
        cbxUnidadMedida.setEnabled(false);

        btnAgregarComponente.setText("Agregar");

        btnQuitar.setText("Quitar");

        btnNuevoDetalle.setText("Nuevo");

        javax.swing.GroupLayout jPanelEstructuraProductoLayout = new javax.swing.GroupLayout(jPanelEstructuraProducto);
        jPanelEstructuraProducto.setLayout(jPanelEstructuraProductoLayout);
        jPanelEstructuraProductoLayout.setHorizontalGroup(
            jPanelEstructuraProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelEstructuraProductoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelEstructuraProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1141, Short.MAX_VALUE)
                    .addGroup(jPanelEstructuraProductoLayout.createSequentialGroup()
                        .addComponent(autoCompletarComponente, javax.swing.GroupLayout.PREFERRED_SIZE, 434, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCantidad, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cbxUnidadMedida, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnAgregarComponente, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnQuitar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnNuevoDetalle)))
                .addContainerGap())
        );

        jPanelEstructuraProductoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnAgregarComponente, btnNuevoDetalle, btnQuitar});

        jPanelEstructuraProductoLayout.setVerticalGroup(
            jPanelEstructuraProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelEstructuraProductoLayout.createSequentialGroup()
                .addGroup(jPanelEstructuraProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelEstructuraProductoLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(autoCompletarComponente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelEstructuraProductoLayout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(jPanelEstructuraProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(cbxUnidadMedida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnAgregarComponente)
                            .addComponent(btnQuitar)
                            .addComponent(btnNuevoDetalle)
                            .addComponent(txtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                .addGap(14, 14, 14))
        );

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        btnGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/estructurassa/utiles/iconos/folder_download-32.png"))); // NOI18N
        btnGuardar.setText("Guardar");
        btnGuardar.setFocusable(false);
        btnGuardar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnGuardar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(btnGuardar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 1193, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelEstructuraProducto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelEstructuraProducto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private autocompletar.componente.AutoCompletarTextField autoCompletarComponente;
    private javax.swing.JButton btnAgregarComponente;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JButton btnNuevaClasificacion;
    private javax.swing.JButton btnNuevoDetalle;
    private javax.swing.JButton btnQuitar;
    private javax.swing.JComboBox cbxClasificación;
    private javax.swing.JComboBox cbxModeloGestStock;
    private javax.swing.JComboBox cbxUnidadMedida;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanelEstructuraProducto;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JLabel lblPorcentajeG;
    private javax.swing.JTable tblEstructura;
    private javax.swing.JTextField txtCantidad;
    private javax.swing.JTextField txtCostoAlmacenamiento;
    private javax.swing.JTextField txtDescripcion;
    private javax.swing.JTextField txtNombre;
    private javax.swing.JFormattedTextField txtPorcentaje;
    // End of variables declaration//GEN-END:variables
}
